define([ "underscoreBase", "marionette", "vent", "views/${domainClass}CollectionView", "collections/${domainClass}Collection"],
		function(_, Marionette, vent, ${capDomainClass}CollectionView, ${capDomainClass}Collection) {

			var ${capDomainClass}TableView = Marionette.CompositeView.extend({

				template : "#tpl-${domainClass}-table",
				${domainClass}Collection : null,
				collectionView: null,
				
				ui : {
					table: "table",
					addBtn :"#add${capDomainClass}Btn"
				},

				events : {
					'click @ui.addBtn': 'add${capDomainClass}'
				},

				onRender : function() {
					
					this.${domainClass}Collection = new ${capDomainClass}Collection();
					
					this.${domainClass}Collection.fetch();
					
					this.collectionView = new ${capDomainClass}CollectionView({collection:this.${domainClass}Collection});
					
					this.ui.table.append(this.collectionView.render().el);
				},
				
				add${capDomainClass} : function(){
					var ${domainClass}Instance = this.${domainClass}Collection.add({id:null});
					
					vent.trigger('added${capDomainClass}',  ${domainClass}Instance);
				}
			});

			return ${capDomainClass}TableView;
		});